class AcademicDegreesController < ApplicationController
  layout 'educational_plans'
  # GET /academic_degrees
  # GET /academic_degrees.xml
  def index
    @academic_degrees = AcademicDegree.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @academic_degrees }
    end
  end

  # GET /academic_degrees/1
  # GET /academic_degrees/1.xml
  def show
    @academic_degree = AcademicDegree.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @academic_degree }
    end
  end

  # GET /academic_degrees/new
  # GET /academic_degrees/new.xml
  def new
    @academic_degree = AcademicDegree.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @academic_degree }
    end
  end

  # GET /academic_degrees/1/edit
  def edit
    @academic_degree = AcademicDegree.find(params[:id])
  end

  # POST /academic_degrees
  # POST /academic_degrees.xml
  def create
    @academic_degree = AcademicDegree.new(params[:academic_degree])

    respond_to do |format|
      if @academic_degree.save
        flash[:notice] = 'AcademicDegree was successfully created.'
        format.html { redirect_to(@academic_degree) }
        format.xml  { render :xml => @academic_degree, :status => :created, :location => @academic_degree }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @academic_degree.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /academic_degrees/1
  # PUT /academic_degrees/1.xml
  def update
    @academic_degree = AcademicDegree.find(params[:id])

    respond_to do |format|
      if @academic_degree.update_attributes(params[:academic_degree])
        flash[:notice] = 'AcademicDegree was successfully updated.'
        format.html { redirect_to(@academic_degree) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @academic_degree.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /academic_degrees/1
  # DELETE /academic_degrees/1.xml
  def destroy
    @academic_degree = AcademicDegree.find(params[:id])
    @academic_degree.destroy

    respond_to do |format|
      format.html { redirect_to(academic_degrees_url) }
      format.xml  { head :ok }
    end
  end
end
